package org.niugang.dubbo.provider;

import java.io.IOException;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.ServiceConfig;
/**
 * 
 * @ClassName:  Provider   
 * @Description:服务提供者
 * @author: niugang
 * @date:   2018年8月17日 上午11:03:44   
 * @Copyright: 863263957@qq.com. All rights reserved. 
 *
 */
public class Provider {
	
	public static void main(String[] args) throws IOException {

		ServiceConfig<GreetingService> serviceConfig = new ServiceConfig<GreetingService>();
		// 应用信息
		serviceConfig.setApplication(new ApplicationConfig("first-dubbo-provider"));
		// 注册中心 redis当注册中心
		serviceConfig.setRegistry(new RegistryConfig("redis://localhost:6379"));
		// 
		serviceConfig.setInterface(GreetingService.class);
		// 接口实现类引用
		serviceConfig.setRef(new GreetingServiceImpl());
		serviceConfig.export();
		System.in.read();
	}
}
